unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages,
  System.SysUtils, System.Types, System.UITypes, System.Rtti, System.Classes,
  System.Variants, FMX.Types, FMX.Controls, FMX.Forms, FMX.Dialogs, FMX.Objects,
  FMX.ZYJ.BitmapButton, FMX.ZYJ.HintWindow, FMX.Filter.Effects,
  FMX.Ani, FMX.ZYJ.TrayIcon, FMX.ZYJ.Win.MessageManager, FMX.Effects,
  FMX.Layouts, FMX.TabControl, FMX.ZYJ.Win.LinkLabel, FMX.ZYJ.Win.WebBrowser,
  FMX.Edit;

type
  TForm1 = class(TForm)
    Button1: TButton;
    lyt1: TLayout;
    pnl1: TPanel;
    tbc1: TTabControl;
    tbtm1: TTabItem;
    tbtm2: TTabItem;
    tbtm3: TTabItem;
    Edit1: TEdit;
    wbrwsr1: TZYJWebBrowser;
    procedure Button1Click(Sender: TObject);
    procedure wbrwsr1JSExternal(const func: string; const args: WideString;
      var retval: WideString);
  private
//    FCurLink: string;
  public

  end;

var
  Form1: TForm1;

implementation

{$R *.fmx}

uses Unit2;

procedure TForm1.Button1Click(Sender: TObject);
begin
  wbrwsr1.Navigate(ExtractFilePath(ParamStr(0)) + 'Test.html');
end;

procedure TForm1.wbrwsr1JSExternal(const func: string; const args: WideString;
  var retval: WideString);
begin
  if SameText(func, 'getIsLogin') then
  begin
    retval := '{result:"false"}';
    ShowMessage(func);
  end else if SameText(func, 'saveData') then
  begin
    ShowMessage(args);
    retval := '{result:"false"}';
  end;
end;

end.
